@extends('admin.public.base')


@section('title', '订单详情')


@section('content')

    @if(session('status'))
        <script>
            setTimeout(() => {
                layer.msg("{{session('status')}}");
            }, 100)
        </script>
    @endif

    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        <a href="/admin/orderlist"> 订单管理</a>
        <span class="c-gray en">&gt;</span>
        订单详情
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>

    <div class="Hui-article">
        <article class="cl pd-20">
            <p class="f-20 text-success">
                订单号:{{$order['no']}}
            </p>
            <p class="f-20 text-success">
                订单状态:

                {{--订单状态1新订单 2付款 3发货 4完成 5退货--}}
                @switch($order['orderstatus'])
                    @case(1)
                    <span class="label label-success radius">  新订单,待付款</span>
                    @break

                    @case(2)
                    <span class="label label-danger radius">   已付款</span>
                    @break

                    @case(3)
                    <span class="label label-warning radius">  已发货</span>
                    @break

                    @case(4)
                    完成
                    @break

                    @case(5)
                    <span class="label label-info radius">  发起退货中</span>
                    @break

                    @case(6)
                    <span class="label label-info radius">  退货完成</span>
                    @break
                @endswitch

            </p>

            <p style="float: right; margin-top: -2em; border: 1px solid red; text-align: center; padding-right: 5em; padding-left: 3em; color: red; font-size: 2em">
                操作：
                {{--订单状态1新订单 2付款 3发货 4完成 5退货--}}
                @switch($order['orderstatus'])
                    @case(1)
                    <span class="label label-success radius">新订单,待付款</span>
                    @break

                    @case(2)
                    <a href="/admin/changeorder/{{$order['id']}}/3" onclick="return confirm('确认发货？')" class="label label-danger radius" > 点击发货</a>
                    @break

                    @case(3)
                    <span class="label label-warning radius">已发货</span>
                    @break

                    @case(4)
                    完成
                    @break

                    @case(5)

                    <a href="/admin/changeorder/{{$order['id']}}/6"  onclick="return confirm('确认签收？')" class="label label-info radius" >退货中，确认签收</a>
                    @break

                    @case(6)
                    <span class="label label-warning radius">退货完成</span>
                    @break

                @endswitch
            </p>

            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                <tr>
                    <th colspan="7" scope="col">订单详情

                    </th>
                </tr>
                <tr class="text-c">
                    <th width="80">产品名</th>
                    <th width="80">图片</th>
                    <th width="120">型号</th>
                    <th width="80">单价</th>
                    <th width="80">数量</th>
                    <th width="75">总价</th>
                </tr>
                </thead>
                <tbody>
                @foreach($order->getorderlist as $orderData)
                    <tr class="text-c">
                        <td>{{$orderData['title']}}</td>
                        <td>
                            <img style="width: 100px;" src="/{{$orderData['img']}}">
                        </td>
                        <td class="f-14 td-manage">

                            {{$orderData['lists']}}
                        </td>

                        <td>
                            {{$orderData['price']}}
                        </td>

                        <td>
                            {{$orderData['num']}}
                        </td>

                        <td>
                            {{$orderData['total']}}
                        </td>


                    </tr>

                @endforeach

                </tbody>
            </table>


            <table class="table table-border table-bordered mt-20 table-bg table-hover table-sort">
                <thead>
                <tr>
                    <th colspan="6" scope="col">订单信息</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <th width="30%">订单号</th>
                    <th>订单状态</th>
                    <th>支付类型</th>

                </tr>
                <tr>
                    <td>{{$order['no']}}</td>
                    <td>
                        {{--订单状态1新订单 2付款 3发货 4完成 5退货--}}
                        @switch($order['orderstatus'])
                            @case(1)
                            <span class="label label-success radius">  新订单,待付款</span>
                            @break

                            @case(2)
                            <span class="label label-danger radius">   已付款</span>
                            @break

                            @case(3)
                            <span class="label label-warning radius">  已发货</span>
                            @break

                            @case(4)
                            完成
                            @break

                            @case(5)
                            <span class="label label-info radius">  发起退货中</span>
                            @break

                            @case(6)
                            <span class="label label-info radius">  退货完成</span>
                            @break
                        @endswitch
                    </td>
                    <td>
                        @switch($order['paytype'])
                            @case(1)
                            <span class="label label-success radius"> 支付宝</span>
                            @break
                            @case(2)
                            <span class="label label-danger radius"> 微信</span>
                            @break
                            @default
                            dont't konw
                        @endswitch
                    </td>
                </tr>

                </tbody>
            </table>

            <table class="table table-border table-bordered mt-20 table-bg table-hover table-sort">
                <thead>
                <tr>
                    <th colspan="6" scope="col">收货信息</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <th width="30%">收货人</th>
                    <th>收货人电话</th>
                    <th>收货人地址</th>
                    <th>收货人地址详情</th>

                </tr>

                <tr>
                    <td>{{$address['name']}}</td>
                    <td>{{$address['tel']}}</td>
                    <td>{{$address['sheng']}} - {{$address['shi']}} -{{$address['qu']}}</td>
                    <td>{{$address['address']}}</td>

                </tr>
                </tbody>
            </table>

        </article>


    </div>


@endsection

